// api.js
import Request from './request'; // 假设你有一个基础的请求方法封装
export default {
  getInboundPage(params) {
    // 获取入库单
    return Request.post({
      url: `/pda/inbound/order/page`,
      data: params
    });
  },
  getInboundDetailPage(params) {
    // 获取入库单明细
    return Request.post({
      url: `/pda/inbound/order/detail/page`,
      data: params
    });
  },
  getInboundDetail(params) {
    // 获取入库单明细
    return Request.get({
      url: `/pda/inbound/order/detail/info/${params.id}`,
      data: {}
    });
  },
  getInboundDetailByCode(params) {
    // 获取入库单明细
    return Request.post({
      url: `/pda/inbound/order/detail/info/stock-code?stockcode=${params.stockCode}`,
      data: {}
    });
  },
  batchInbound(params) {
    // 入库
    return Request.put({
      url: `/pda/inbound/order/batch-inbound`,
      data: params
    });
  },
  getOutboundPage(params) {
    // 获取出库单
    return Request.post({
      url: `/pda/outbound/order/page`,
      data: params
    });
  },
  getOutboundDetailPage(params) {
    // 获取出库单明细
    return Request.post({
      url: `/pda/outbound/order/detail/page`,
      data: params
    });
  },
  getOutboundDetail(params) {
    // 获取出库单明细
    return Request.get({
      url: `/pda/outbound/order/detail/info/${params.id}`,
      data: {}
    });
  },
  getOutboundDetailByCode(params) {
    return Request.post({
      url: `/pda/outbound/order/detail/info/stock-code?stockcode=${params.stockCode}`,
      data: {}
    });
  },
  batchOutbound(params) {
    // 出库
    return Request.put({
      url: `/pda/outbound/order/batch-outbound`,
      data: params
    });
  },
  getStockCheckPage(params) {
    // 获取盘点单
    return Request.post({
      url: `/pda/stock-check/page`,
      data: params
    });
  },
  getStockCheckDetailPage(params) {
    // 获取盘点单明细
    return Request.post({
      url: `/pda/stock-check-detail/page`,
      data: params
    });
  },
  putStockCheckDetailPreCheck(data) {
    // 手动盘点
    return Request.put({
      url: `/pda/stock-check-detail/pre-check`,
      data
    });
  },
  getAllocateInboundPage(params) {
    // 获取调拨入库单
    return Request.post({
      url: `/pda/inbound/order/page`,
      data: params
    });
  },
  getAllocateOutboundPage(params) {
    // 获取调拨出库单
    return Request.post({
      url: `/pda/outbound/order/page`,
      data: params
    });
  },
  getAllocateInboundDetailPage(params) {
    // 获取调拨入库明细单
    return Request.post({
      url: `/pda/inbound/order/detail/page`,
      data: params
    });
  },
  getAllocateOutboundDetailPage(params) {
    // 获取调拨出库明细单
    return Request.post({
      url: `/pda/outbound/order/detail/page`,
      data: params
    });
  },
  putAllocateInboundDetail(data) {
    // 手动调拨入库明细单
    return Request.put({
      url: `/pda/allocate/inbound/order/batch-inbound`,
      data
    });
  },
  putAllocateOutboundDetail(data) {
    // 手动调拨出库明细单
    return Request.put({
      url: `/pda/allocate/outbound/order/batch-outbound`,
      data
    });
  },

  postStoreAllocateInboundPage(data) {
    // 跨门店调拨确认 调入列表
    return Request.post({
      url: '/pda/inbound/order/page/confirm',
      data
    })
  },

  postStoreAllocateOutboundPage(data) {
    // 跨门店调拨确认 调出列表
    return Request.post({
      url: '/pda/outbound/order/page/confirm',
      data
    })
  },

  putStoreAllocateBatchInbound(data, type) {
    // 跨门店调拨确认 入库手动调拨
    return Request.put({
      url: `/pda/allocate/inbound/order/${type}/batch-inbound`,
      data
    })
  },

  putStoreAllocateBatchOutbound(data, type) {
    // 跨门店调拨确认 出库手动调拨
    return Request.put({
      url: `/pda/allocate/outbound/order/${type}/batch-outbound`,
      data
    })
  },

  storageSearchList(params) {
    return Request.get({
      url: `/storage_search_list`,
      data: params
    });
  }
};
